package com.excilys.blog.refactoring.refactored;

import com.excilys.blog.refactoring.GeoPoint;

class WestPositionDelta extends PositionDelta {

    public WestPositionDelta(GeoPoint firstPoint, GeoPoint secondPoint) {
        super(firstPoint, secondPoint);
    }

    @Override
    protected boolean isInGoodDirection() {
        return isPointWesterOrSameButNorther();
    }

    private boolean isPointWesterOrSameButNorther() {
        return longitudeDelta < 0 || longitudeDelta == 0 && latitudeDelta > 0;
    }

}
